clear all
**Change Working Directory
cd " "

import delimited "Study 1 - Politics vs Entertainment.csv", encoding(UTF-8) 

**A bot responded to the survey 1,839 times. We remove those cases.
gen bad_data = ftouch
encode bad_data, generate(bad_data2)
recode bad_data2  1/1047=0 1048=1

keep if bad_data2==0

gen pol_treat=1 if dobrfl_8=="Version 1: Politics Block"
replace pol_treat=0 if dobrfl_8=="Version 2: Entertainment Block"
replace pol_treat=1 if dobrfl_8=="Version 3: Politics, no questions block"
replace pol_treat=0 if dobrfl_8=="Version 4: Entertainment Block"

gen order_treat=0 if dobrfl_8=="Version 1: Politics Block"
replace order_treat=0 if dobrfl_8=="Version 2: Entertainment Block"
replace order_treat=1 if dobrfl_8=="Version 3: Politics, no questions block"
replace order_treat=1 if dobrfl_8=="Version 4: Entertainment Block"

gen defect  = v10
recode defect 1=0 0=1

**Figure 1 & SI1.1 Model 1
logit defect i.pol_treat##i.order_treat 
margins pol_treat, at(order_treat=(0 1))
margins, dydx(pol_treat) at(order_treat=(0 1))

**SI1.1 Model 2
regr defect i.pol_treat##i.order_treat 
margins pol_treat, at(order_treat=(0 1))
margins, dydx(pol_treat) at(order_treat=(0 1))

**Study 2
use "Study 2 - Survey Selection 1.dta", clear

gen politics_treat = q1
gen poldebate_treat = q69
gen poldelib_treat = q70

gen debate_treat =.
recode debate_treat .=0 if politics_treat ==1
recode debate_treat .=0 if politics_treat ==2
recode debate_treat .=1 if poldebate_treat ==1
recode debate_treat .=1 if poldebate_treat ==2
recode debate_treat .=0 if poldelib_treat ==1
recode debate_treat .=0 if poldelib_treat ==2

gen delib_treat =.
recode delib_treat .=0 if politics_treat ==1
recode delib_treat .=0 if politics_treat ==2
recode delib_treat .=0 if poldebate_treat ==1
recode delib_treat .=0 if poldebate_treat ==2
recode delib_treat .=1 if poldelib_treat ==1
recode delib_treat .=1 if poldelib_treat ==2

gen polDV =.
recode polDV .=1 if politics_treat ==1
recode polDV .=0 if politics_treat ==2
recode polDV .=1 if poldebate_treat ==1
recode polDV .=0 if poldebate_treat ==2
recode polDV .=1 if poldelib_treat ==1
recode polDV .=0 if poldelib_treat ==2

**Measuring Conflict Avoidance
gen conavoid = q77
recode conavoid 1=1 2=0
gen conavoid_rev=conavoid
recode conavoid_rev 1=0 0=1


gen female = q21
recode female 1=0 2=1

gen income = var100-1

gen education = q17
gen education2 = (education-1)/7

gen pid = .
recode pid .=7 if q2==1 & q3==1
recode pid .=6 if q2==1 & q3==2
recode pid .=5 if q2==3 & q5==3
recode pid .=4 if q2==3 & q5==2
recode pid .=3 if q2==3 & q5==1
recode pid .=2 if q2==2 & q4==2
recode pid .=1 if q2==2 & q4==1

gen pidst = abs(pid-4)
gen pidst2=pidst/3

**Figure 3 Left Side & SI3.1
prtest conavoid_rev, by(polDV)

**SI3.2 Model (1)
logit polDV i.delib_treat##i.conavoid_rev i.debate_treat##i.conavoid_rev
**SI3.2 Model (2)
regr polDV i.delib_treat##i.conavoid_rev i.debate_treat##i.conavoid_rev
**SI3.2 Model (3)
logit polDV i.delib_treat##i.conavoid_rev i.debate_treat##i.conavoid_rev education2 pidst2 female income
**SI3.2 Model (4)
regr polDV i.delib_treat##i.conavoid_rev i.debate_treat##i.conavoid_rev education2 pidst2 female income

**SI3.3 Model (1)
logit polDV i.delib_treat##i.conavoid_rev i.debate_treat##i.conavoid_rev i.delib_treat##c.education2 i.debate_treat##c.education2 

**SI3.3 Model (2)
regr polDV i.delib_treat##i.conavoid_rev i.debate_treat##i.conavoid_rev i.delib_treat##c.education2 i.debate_treat##c.education2 

**DA9.1 (1)
ttest conavoid_rev, by(female)

**DA9.2 (1)
logit polDV i.female 
margins female 
margins, dydx(female)

**DA9.2 (2)
logit polDV i.female if debate_treat==1
margins female 
margins, dydx(female)

**DA9.2 (3)
logit polDV i.female if delib_treat==1
margins female 
margins, dydx(female)


**Study 3
import delimited "Study 3 - Survey Selection 2.csv", encoding(UTF-8) clear

duplicates  tag locationlatitude locationlongitude, gen(locdup)
drop if locdup>=8

gen pol_survey=.
recode pol_survey .=1 if control==1
recode pol_survey .=1 if contentious==1
recode pol_survey .=1 if respect ==1
recode pol_survey .=0 if control==2
recode pol_survey .=0 if control==3
recode pol_survey .=0 if control==4
recode pol_survey .=0 if control==5
recode pol_survey .=0 if contentious==2
recode pol_survey .=0 if contentious==3
recode pol_survey .=0 if contentious==4
recode pol_survey .=0 if contentious==5
recode pol_survey .=0 if respect==2 
recode pol_survey .=0 if respect==3
recode pol_survey .=0 if respect==4
recode pol_survey .=0 if respect==5

gen pol_survey1=.
recode pol_survey1 .=1 if control==1
recode pol_survey1 .=1 if contentious==1
recode pol_survey1 .=1 if respect ==1
recode pol_survey1 .=0 if control==2
recode pol_survey1 .=0 if control==3
recode pol_survey1 .=0 if control==4
recode pol_survey1 .=0 if contentious==2
recode pol_survey1 .=0 if contentious==3
recode pol_survey1 .=0 if contentious==4
recode pol_survey1 .=0 if respect==2 
recode pol_survey1 .=0 if respect==3
recode pol_survey1 .=0 if respect==4

gen treatments=0 if control!=.
replace treatments=1 if contentious!=.
replace treatments=2 if respect!=.
label define treatlab 0 "Control" 1 "Contentious" 2 "Respect"
label values treatments treatlab

gen conavoid=ca
**AVOIDANT = 1
recode conavoid 1=0 2=1

gen female=gender
recode female 1=0 2=1 3=.

replace educ=educ-1

**Figure 3 Right Side & SI4.1
prtest conavoid, by(pol_survey1)
prtest conavoid, by(pol_survey)

*SI4.2 (Model 1)
logit pol_survey i.conavoid##i.treatments
*SI4.2 (Model 2)
reg pol_survey i.conavoid##i.treatments
*SI4.2 (Model 3)
logit pol_survey1 i.conavoid##i.treatments
*SI4.2 (Model 4)
reg pol_survey1 i.conavoid##i.treatments

*SI4.3 (Model 1)
logit pol_survey i.conavoid##i.treatments c.educ##i.treatments
*SI4.3 (Model 2)
reg pol_survey i.conavoid##i.treatments c.educ##i.treatments
*SI4.3 (Model 3)
logit pol_survey1 i.conavoid##i.treatments c.educ##i.treatments
*SI4.3 (Model 4)
reg pol_survey1 i.conavoid##i.treatments c.educ##i.treatments

**DA9.1 (2)
ttest conavoid, by(female)

**DA9.2 (4)
ttest pol_survey if control!=., by(female)
**DA9.2 (5)
ttest pol_survey if contentious!=., by(female)
**DA9.2 (6)
ttest pol_survey if respect!=., by(female)
**DA9.2 (7)
ttest pol_survey, by(female)


**Study 4
import delimited "Study 4 - Dinner Conversation 1.csv", clear 
gen DV1 = movienone  
gen DV2 = polnone 
gen DV3 = movieprompt 
gen DV4 = polprompt

recode DV1 1=1 2=0 
recode DV2 1=1 2=0 
recode DV3 1=1 2=0 
recode DV4 1=1 2=0 

gen attend = DV1 if DV2 ==. & DV3==. & DV4==.
replace attend = DV2 if DV1 ==. & DV3==. & DV4==.
replace attend = DV3 if DV1 ==. & DV2==. & DV4==.
replace attend = DV4 if DV1 ==. & DV2==. & DV3==.


gen poltreat = 1 if polprompt !=. | polnone!=.
replace poltreat = 0 if movieprompt !=. | movienone!=.

gen asktreat = 1 if polprompt !=. | movieprompt!=.
replace asktreat = 0 if polnone !=.  | movienone!=.

gen female=v12
recode female 1=0 2=1 3=.

**Figure 2 & SI2.1 Model 1
logit attend i.poltreat##i.asktreat 
margins,  at(poltreat=(0 1) asktreat=(0 1))
margins, dydx(poltreat) at(asktreat=(0 1))
margins, dydx(asktreat) at(poltreat=(0 1))

**SI2.1 Model 2
regr attend i.poltreat##i.asktreat 

**DA9.2 (8)
ttest attend if poltreat==0, by(female)
**DA9.2 (9)
ttest attend if poltreat==1, by(female)


**Study 5
import delimited "Study 5 - Dinner Conversation 2.csv", clear 
gen accept =.
recode accept .=0 if q32==2
recode accept .=0 if q34==2
recode accept .=0 if v32==2
recode accept .=0 if q23==2
recode accept .=1 if q32==1
recode accept .=1 if q34==1
recode accept .=1 if v32==1
recode accept .=1 if q23==1

gen conflict1 = q24
recode conflict1 1=1 2=0
gen conflict_avoid = conflict1
recode conflict_avoid 0=1 1=0

gen politics = .
recode politics .=0 if treatmentdv_do_q32==1 
recode politics .=0 if treatmentdv_do_q22==1 
recode politics .=1 if treatmentdv_do_q34==1 
recode politics .=1 if treatmentdv_do_q23==1 

gen delib = .
recode delib .=0 if treatmentdv_do_q32==1 
recode delib .=1 if treatmentdv_do_q22==1 
recode delib .=0 if treatmentdv_do_q34==1 
recode delib .=1 if treatmentdv_do_q23==1 


gen ideology = q14
recode ideology 8=.
gen ideologyst = abs(ideology-4)
gen ideologyst2 = ideologyst/3


gen pid = .
recode pid . = 1 if q20 == 1
recode pid . = 2 if q20 == 2
recode pid . = 3 if q22 == 2
recode pid . = 4 if q22 == 3
recode pid . = 5 if q22 == 1
recode pid . = 6 if q18 == 2
recode pid . = 7 if q18 == 1

gen pidst = abs(pid-4)
gen pidst2 = pidst/3

gen politics_int = q27_1
gen movies_int = q27_2
gen education = q26
recode education 8=.

gen movies_int2 = movies_int/10
gen politics_int2 = politics_int/10
gen education2 = (education-1)/6

gen demtherm = q12_1
gen reptherm = q12_2
gen aff_polar = abs((demtherm-reptherm)/100)

gen female=q10
recode female 1=0 2=1 3=.

**SI2.2
prtest conflict_avoid if accept==1, by(politics)


**Figure 4 & SI2.3 (Model 1)
logit accept i.politics##i.conflict_avoid i.delib 
margins politics, at(conflict_avoid=0)
margins politics, at(conflict_avoid=1)

**SI2.3 (Model 2)
regr accept i.politics##i.conflict_avoid i.delib 

**SI2.4 (Model 1)
logit accept i.politics##i.delib if conflict_avoid==0

**SI2.4 (Model 2)
logit accept i.politics##i.delib if conflict_avoid==1

**SI2.4 (Model 3)
regr accept i.politics##i.delib if conflict_avoid==0

**SI2.4 (Model 4)
regr accept i.politics##i.delib if conflict_avoid==1

**SI2.5 (Model 1)
logit accept i.politics##i.conflict_avoid 

**SI2.5 (Model 2)
logit accept i.politics##i.conflict_avoid pidst2 ideologyst2 aff_polar politics_int2 movies_int2 c.education2

**SI2.5 (Model 3)
logit accept i.politics##i.conflict_avoid i.politics##c.pidst2 i.politics##c.ideologyst2 i.politics##c.aff_polar i.politics##c.politics_int2 i.politics##c.movies_int2 i.politics##c.education2

**DA9.1 (3)
ttest conflict_avoid, by(female)

**DA9.2 (10)
ttest accept if politics==0, by(female)
**DA9.2 (11)
ttest accept if politics==1, by(female)

**Study 6
use "Study 6 - Pew W48.dta", clear
merge 1:1 QKEY using "Study 6 - Pew W10.dta"


gen ca1= CNFLCT1_
recode ca1 99=.
gen ca2= CNFLCT2_
recode ca2 99=.
gen ca3= CNFLCT3_
recode ca3 99=.

gen ca2rev =ca2
recode ca2rev 4=1 3=2 2=3 1=4

alpha ca1 ca2rev ca3

gen cafull=ca1+ca2rev+ca3

gen cafull_rev=cafull
recode cafull_rev 12=3 11=4 10=5 9=6 8=7 7=8 6=9 5=10 4=11 3=12
**check
corr cafull cafull_rev
**rescale 0 to 1
gen cafull_rev1=(cafull_rev-3)/9

**DVs 
**Politics
**note = bw first download and second, ATP added W48 to the variable 
gen poltalk=CONVOFFa_W48
recode poltalk 1=4 2=3 3=2 4=1 99=.
gen poltalk2=poltalk
recode poltalk2 1=0 2=0 3=1 4=1

gen trumptalk=CONVOFFb_W48
recode trumptalk 1=4 2=3 3=2 4=1 99=.
gen trumptalk2=trumptalk
recode trumptalk2 1=0 2=0 3=1 4=1

gen econtalk=CONVOFFc_W48
recode econtalk 1=4 2=3 3=2 4=1 99=.
gen econtalk2=econtalk
recode econtalk2 1=0 2=0 3=1 4=1

gen religtalk=CONVOFFd_W48
recode religtalk 1=4 2=3 3=2 4=1 99=.
gen religtalk2=religtalk
recode religtalk2 1=0 2=0 3=1 4=1

gen weathertalk=CONVOFFe_W48
recode weathertalk 1=4 2=3 3=2 4=1 99=.
gen weathertalk2=weathertalk
recode weathertalk2 1=0 2=0 3=1 4=1

gen sporttalk=CONVOFFf_W48
recode sporttalk 1=4 2=3 3=2 4=1 99=.
gen sporttalk2=sporttalk
recode sporttalk2 1=0 2=0 3=1 4=1

gen movietalk=CONVOFFg_W48
recode movietalk 1=4 2=3 3=2 4=1 99=.
gen movietalk2=movietalk
recode movietalk2 1=0 2=0 3=1 4=1


**Controls
gen dem=F_PARTYSUM_FINAL
recode dem 1=0 2=1 9=0
gen rep=F_PARTYSUM_FINAL
recode rep 1=1 2=0 9=0

gen ideo=F_IDEO
recode ideo 99=.

gen income=F_INCOME
recode income 99=.

gen religious=F_ATTEND
recode religious 99=.

gen age=F_AGECAT
recode age 99=.

gen female=F_SEX
recode female 1=0 2=1 99=.

gen educ=F_EDUCCAT2
recode educ 99=.

gen black=F_RACETHN
recode black 1=0 2=1 3/4=0 99=.
recode black 9=.

gen white=F_RACETHN
recode white 1=1 2/4=0 99=.
recode white 9=.

gen asian=F_RACECMB
recode asian 1=0 2=0 3=1 4=0 5=0 99=.


gen latin=F_RACETHN
recode latin 1=0 2=0 3=1 4=0 99=.
recode latin 9=.

gen citizen=F_CITIZEN
recode citizen 1=1 2=0 99=.

gen immigrant=F_NATIVITY
recode immigrant 1=1 2=1 3=1 4=0 99=.

**Figure 5 & SI5.1
logit poltalk2 cafull_rev1 dem rep ideo income religious age female educ black latin white 
*margins, at(cafull_rev1=(0(.01)1))
logit trumptalk2 cafull_rev1 dem rep ideo income religious age female educ black latin white 
*margins, at(cafull_rev1=(0(.01)1))
logit econtalk2 cafull_rev1 dem rep ideo income religious age female educ black latin white 
*margins, at(cafull_rev1=(0(.01)1))
logit religtalk2 cafull_rev1 dem rep ideo income religious age female educ black latin white 
*margins, at(cafull_rev1=(0(.01)1))
logit weathertalk2 cafull_rev1 dem rep ideo income religious age female educ black latin white 
*margins, at(cafull_rev1=(0(.01)1))
logit sporttalk2 cafull_rev1 dem rep ideo income religious age female educ black latin white 
*margins, at(cafull_rev1=(0(.01)1))
logit movietalk2 cafull_rev1 dem rep ideo income religious age female educ black latin white 
*margins, at(cafull_rev1=(0(.01)1))

**SI5.2.1
regr poltalk cafull_rev1 dem rep ideo income religious age female educ black latin white 
regr trumptalk cafull_rev1 dem rep ideo income religious age female educ black latin white 
regr econtalk cafull_rev1 dem rep ideo income religious age female educ black latin white 
regr religtalk cafull_rev1 dem rep ideo income religious age female educ black latin white 
regr weathertalk cafull_rev1 dem rep ideo income religious age female educ black latin white 
regr sporttalk cafull_rev1 dem rep ideo income religious age female educ black latin white 
regr movietalk cafull_rev1 dem rep ideo income religious age female educ black latin white 

**SI5.2.2
regr poltalk2 cafull_rev1 dem rep ideo income religious age female educ black latin white [pweight=WEIGHT_W48]
regr trumptalk2 cafull_rev1 dem rep ideo income religious age female educ black latin white [pweight=WEIGHT_W48]
regr econtalk2 cafull_rev1 dem rep ideo income religious age female educ black latin white [pweight=WEIGHT_W48]
regr religtalk2 cafull_rev1 dem rep ideo income religious age female educ black latin white [pweight=WEIGHT_W48]
regr weathertalk2 cafull_rev1 dem rep ideo income religious age female educ black latin white [pweight=WEIGHT_W48]
regr sporttalk2 cafull_rev1 dem rep ideo income religious age female educ black latin white [pweight=WEIGHT_W48]
regr movietalk2 cafull_rev1 dem rep ideo income religious age female educ black latin white [pweight=WEIGHT_W48]

**SI5.2.3
sureg (trumptalk2 econtalk2 = cafull_rev1 dem rep ideo income religious age female educ black latin white) 
sureg (trumptalk2 religtalk2 = cafull_rev1 dem rep ideo income religious age female educ black latin white) 
sureg (trumptalk2 weathertalk2 = cafull_rev1 dem rep ideo income religious age female educ black latin white) 
sureg (trumptalk2 sporttalk2 = cafull_rev1 dem rep ideo income religious age female educ black latin white) 
sureg (trumptalk2 movietalk2 = cafull_rev1 dem rep ideo income religious age female educ black latin white) 

sureg (poltalk2 econtalk2 = cafull_rev1 dem rep ideo income religious age female educ black latin white) 
sureg (poltalk2 religtalk2 = cafull_rev1 dem rep ideo income religious age female educ black latin white) 
sureg (poltalk2 weathertalk2 = cafull_rev1 dem rep ideo income religious age female educ black latin white) 
sureg (poltalk2 sporttalk2 = cafull_rev1 dem rep ideo income religious age female educ black latin white) 
sureg (poltalk2 movietalk2 = cafull_rev1 dem rep ideo income religious age female educ black latin white) 


**Knowledge, W10
gen pipeline1=K1_W10 
recode pipeline1 1=0 2=0 3=1 4=0 99=0

gen mlk1=K2_W10
recode mlk1 1=0 2=1 3=0 4=0 99=0

gen pope1=K3_W10
recode pope1 1=0 2=1 3=0 4=0 99=0

gen cuba1=K4_W10
recode cuba1 1=0 2=0 3=1 4=0 99=0

gen malala1=K5_W10
recode malala1 1=1 2=0 3=0 4=0 99=0

gen taxes1=K6_W10
recode taxes1 1=0 2=0 3=1 4=0 99=0

gen stat1=K7_W10
recode stat1 1=0 2=0 3=0 4=1 99=0

gen guan1=K8_W10
recode guan1 1=0 2=1 3=0 4=0 99=0

gen supreme1=K9_W10
recode supreme1 1=0 2=0 3=1 4=0 99=0

gen kji1=K10_W10
recode kji1 1=1 2=0 3=0 4=0 99=0

gen major1=K11_W10
recode major1 1=0 2=0 3=0 4=1 99=0

gen afghanistan1=K12_W10
recode afghanistan1 1=0 2=1 3=0 4=0 99=0

gen warren1=K13_W10
recode warren1 1=1 2=0 3=0 4=0 99=0

gen full_know1=pipeline1+mlk1+pope1+cuba1+malala1+taxes1+stat1+guan1+supreme1+kji1+major1+afghanistan1+warren1


**DA5.1.2
logit poltalk2 cafull_rev1 full_know1 dem rep ideo income religious age female educ black latin white 
logit trumptalk2 cafull_rev1 full_know1 dem rep ideo income religious age female educ black latin white 

**DA5.1.3
logit poltalk2 c.cafull_rev1##c.full_know1 dem rep ideo income religious age female educ black latin white 
logit trumptalk2 c.cafull_rev1##c.full_know1 dem rep ideo income religious age female educ black latin white 

**SI8 Model 1
regr cafull_rev1 female latin asian black educ age income religious i.immigrant##i.citizen 
**SI8 Model 2
regr cafull_rev1 female latin asian black educ age income religious i.immigrant##i.citizen [pweight=WEIGHT_W48]

**DA9.1 (6)
regr cafull_rev1 female

**DA9.2 (Figure Values)
ttest poltalk, by(female)
ttest trumptalk, by(female)
ttest econtalk, by(female)
ttest religtalk, by(female)
ttest weathertalk, by(female)
ttest sporttalk, by(female)
ttest movietalk, by(female)


**DA9
regr poltalk female  dem rep ideo income religious age educ black latin white 
regr trumptalk female dem rep ideo income religious age educ black latin white 
regr econtalk female dem rep ideo income religious age educ black latin white 
regr religtalk female dem rep ideo income religious age educ black latin white 
regr weathertalk female dem rep ideo income religious age educ black latin white 
regr sporttalk female dem rep ideo income religious age educ black latin white 
regr movietalk female dem rep ideo income religious age educ black latin white 


**Study 7
import delimited "Study 7 - Conversation on Issues.csv", clear 

encode fl_88_do, gen(convotreat)

gen poltreat=convotreat
recode poltreat 1=1 2/4=0
gen climtreat=convotreat
recode climtreat 1=0 2=1 3/4=0
gen racetreat=convotreat
recode racetreat 1/2=0 3=0 4=1
gen lobbytreat=convotreat
recode lobbytreat 1/2=0 3=1 4=0

**higher values = less comfort 
gen fullcomfort=.
replace fullcomfort=pol if convotreat==1
replace fullcomfort=climate if convotreat==2
replace fullcomfort=v36 if convotreat==4 
replace fullcomfort=lobby if convotreat==3

gen comfort2=fullcomfort
recode comfort2 1/2=1 3/4=0



**ca=1 seeking, 2 avoidant

recode ca -99=. 3/4=. //note -- this is because this var was originally a copied question w/4 options and was this way in the previews. 
gen ca2=ca
recode ca2 1=0 2=1

**Controls
gen white=race
recode white 1=1 2/7=0

gen educcat=education 
recode educcat 1=1 2=2 3=3 4=3 5=4 6=5 7=5 8=5

gen female=sex
recode female 1=0 2=1 3=.

**Figure 6 & SI6.1 Model 3
logit comfort2 i.climtreat##i.ca2 i.racetreat##i.ca2 i.lobbytreat##i.ca2 if q_relevantidfraudscore<35
margins ca2, at(climtreat=0 racetreat=0 lobbytreat=0)
margins ca2, at(climtreat=1 racetreat=0 lobbytreat=0)
margins ca2, at(climtreat=0 racetreat=1 lobbytreat=0)
margins ca2, at(climtreat=0 racetreat=0 lobbytreat=1)

margins, dydx(climtreat) at(racetreat=0 lobbytreat=0 ca2=0)
margins, dydx(racetreat) at(climtreat=0 lobbytreat=0 ca2=0)
margins, dydx(lobbytreat) at(climtreat=0 racetreat=0 ca2=0)

margins, dydx(climtreat) at(racetreat=0 lobbytreat=0 ca2=1)
margins, dydx(racetreat) at(climtreat=0 lobbytreat=0 ca2=1)
margins, dydx(lobbytreat) at(climtreat=0 racetreat=0 ca2=1)

margins lobbytreat, at(climtreat=0 racetreat=0 ca2=0)
margins lobbytreat, at(climtreat=0 racetreat=0 ca2=1)

**SI6.1 Model 1
regr comfort2 i.climtreat##i.ca2 i.racetreat##i.ca2 i.lobbytreat##i.ca2 if q_relevantidfraudscore<35

**SI6.1 Model 2
regr fullcomfort i.climtreat##i.ca2 i.racetreat##i.ca2 i.lobbytreat##i.ca2 if q_relevantidfraudscore<35


**SI6.2 Model 1
logit comfort2 i.climtreat##i.ca2 i.racetreat##i.ca2 i.lobbytreat##i.ca2 ideo white educcat if q_relevantidfraudscore<35

**SI6.2 Model 2
regr comfort2 i.climtreat##i.ca2 i.racetreat##i.ca2 i.lobbytreat##i.ca2 ideo white educcat if q_relevantidfraudscore<35

**DA9.1 (4)
ttest ca2 if q_relevantidfraudscore<35, by(female)

**Study 8
use "Study 8 - Engagment in Politics.dta", clear
gen ca1=G1
recode ca1 98=.
gen ca2=G2
recode ca2 98=.

gen cafull=ca1+ca2


gen cafull01=(cafull-2)/8

gen interest=.
replace interest = G3A if P_COND==1
replace interest = G3B if P_COND==2
replace interest = G3C if P_COND==3
replace interest = G3D if P_COND==4
replace interest = G3E if P_COND==5
recode interest 98=.

gen white=RACETHNICITY
recode white 1=1 2=0 3=0 4=0 5=0 6=0
gen black= RACETHNICITY
recode black 1=0 2=1 3=0 4=0 5=0 6=0
gen latin= RACETHNICITY
recode latin 1=0 2=0 3=0 4=1 5=0 6=0
gen asian= RACETHNICITY
recode asian 1=0 2=0 3=0 4=0 5=0 6=1
gen female=GENDER
recode female 1=0 2=1
gen male=GENDER
recode male 1=1 2=0

gen min_rel=RELIG
recode min_rel 1/4=0 5/8=1 9/14=0


**SI7 Model 1
reg interest i.P_COND
**Figure 7 & SI7 Model 2
reg interest i.P_COND##c.cafull01
margins, dydx(P_COND) at(cafull01=(0(.05)1))
margins P_COND, at(cafull01=(0))
margins P_COND, at(cafull01=(1))

**SI8 Model 3 and Model 4
regr cafull01 female latin asian black EDUC5 AGE INCOME min_rel
regr cafull01 female latin asian black EDUC5 AGE INCOME min_rel [pweight=WEIGHT]

**DA9.1 (5)
regr cafull01 i.male [pweight=WEIGHT]


**Survey Selection Experiment Included in Original Manuscript
import delimited "Study in DA4 - Survey Selection in Original.csv", clear


**Selecting Politics
gen politics=.
recode politics .=1 if v1==1
recode politics .=0 if v1==2
recode politics .=0 if v1==3
recode politics .=1 if v2==1
recode politics .=0 if v2==2
recode politics .=0 if v2==3
recode politics .=1 if v3==1
recode politics .=0 if v3==2
recode politics .=0 if v3==3

**Selecting Politics, excluding neithers
gen politics2=.
recode politics2 .=1 if v1==1
recode politics2 .=0 if v1==2
recode politics2 .=1 if v2==1
recode politics2 .=0 if v2==2
recode politics2 .=1 if v3==1
recode politics2 .=0 if v3==2


**Full Selection Dependent Variable
gen fulldv=.
recode fulldv .=1 if v1==1
recode fulldv .=2 if v1==2
recode fulldv .=3 if v1==3
recode fulldv .=1 if v2==1
recode fulldv .=2 if v2==2
recode fulldv .=3 if v2==3
recode fulldv .=1 if v3==1
recode fulldv .=2 if v3==2
recode fulldv .=3 if v3==3

**treatments
*1= pol only, 2 = agreement, 3 = disagreement
gen treat=.
recode treat .=1 if v1!=.&v2==.&v3==.
recode treat .=2 if v1==.&v2==.&v3!=.
recode treat .=3 if v1==.&v2!=.&v3==.

gen agree=treat
recode agree 1=0 2=1 3=0
gen disagree=treat
recode disagree 1=0 2=0 3=1

**Woman
gen woman=sex
recode woman 1=0 2=1 3=.

**Conflict Avoidance
gen ca2=ca
recode ca2 1=0 2=1 -99=.

**DA4 - Mean Conflict Avoidance
ttest ca2, by(politics2)

**DA4 - Multinomial Logit
mlogit fulldv i.agree##i.ca2 i.disagree##i.ca2

**DA4 - Logit (model 1)
logit politics2 i.agree##i.ca2 i.disagree##i.ca2

**DA4 - OLS (model 2)
regr politics2 i.agree##i.ca2 i.disagree##i.ca2

**DA9.2 Rows 16-18
ttest politics2 if agree==0 & disagree==0, by(woman)
ttest politics2 if agree==1 & disagree==0, by(woman)
ttest politics2 if agree==0 & disagree==1, by(woman)


**Post-Hoc Check Results in DA7
import delimited "Study in DA7 - Post-Hoc Check.csv", clear
gen markvar=1
sort startdate
gen caseid=_n
save "Study in DA7 temp.dta", replace
import delimited "Study in DA7 - Post-Hoc Check.csv", clear
sort startdate
gen caseid=_n
append using "Study in DA7 temp.dta"
replace markvar=2 if markvar==.


gen contentious=.
replace contentious=convo1_1 if fl_10_do_nodescriptionpol==1 & markvar==1
replace contentious=convo2_1 if fl_10_do_openpol==1 & markvar==1
replace contentious=convo3_1 if fl_10_do_delpol==1 & markvar==1
replace contentious=convo4_1 if fl_10_do_nodescrpub==1 & markvar==1
replace contentious=convo5_1 if fl_10_do_opnpub==1 & markvar==1
replace contentious=convo6_1 if fl_10_do_delibrpub==1 & markvar==1
replace contentious=convo1_1 if fl_10_do_nodescriptionpol==2 & markvar==2
replace contentious=convo2_1 if fl_10_do_openpol==2 & markvar==2
replace contentious=convo3_1 if fl_10_do_delpol==2 & markvar==2
replace contentious=convo4_1 if fl_10_do_nodescrpub==2 & markvar==2
replace contentious=convo5_1 if fl_10_do_opnpub==2 & markvar==2
replace contentious=convo6_1 if fl_10_do_delibrpub==2 & markvar==2

gen mindchange=.
replace mindchange=convo1_2 if fl_10_do_nodescriptionpol==1 & markvar==1
replace mindchange=convo2_2 if fl_10_do_openpol==1 & markvar==1
replace mindchange=convo3_2 if fl_10_do_delpol==1 & markvar==1
replace mindchange=convo4_2 if fl_10_do_nodescrpub==1 & markvar==1
replace mindchange=convo5_2 if fl_10_do_opnpub==1 & markvar==1
replace mindchange=convo6_2 if fl_10_do_delibrpub==1 & markvar==1
replace mindchange=convo1_2 if fl_10_do_nodescriptionpol==2 & markvar==2
replace mindchange=convo2_2 if fl_10_do_openpol==2 & markvar==2
replace mindchange=convo3_2 if fl_10_do_delpol==2 & markvar==2
replace mindchange=convo4_2 if fl_10_do_nodescrpub==2 & markvar==2
replace mindchange=convo5_2 if fl_10_do_opnpub==2 & markvar==2
replace mindchange=convo6_2 if fl_10_do_delibrpub==2 & markvar==2

gen politicstreat=.
recode politicstreat .=1 if fl_10_do_nodescriptionpol==1 & markvar==1
recode politicstreat .=2 if fl_10_do_openpol==1 & markvar==1
recode politicstreat .=3 if fl_10_do_delpol==1 & markvar==1
recode politicstreat .=1 if fl_10_do_nodescriptionpol==2 & markvar==2
recode politicstreat .=2 if fl_10_do_openpol==2 & markvar==2
recode politicstreat .=3 if fl_10_do_delpol==2 & markvar==2

gen policytreat=.
recode policytreat .=1 if fl_10_do_nodescrpub==1 & markvar==1
recode policytreat .=2 if fl_10_do_opnpub==1 & markvar==1
recode policytreat .=3  if fl_10_do_delibrpub==1 & markvar==1
recode policytreat .=1 if fl_10_do_nodescrpub==2 & markvar==2
recode policytreat .=2 if fl_10_do_opnpub==2 & markvar==2
recode policytreat .=3  if fl_10_do_delibrpub==2 & markvar==2


label define treatlab 1 "Control" 2 "Open-Minded" 3 "Deliberative"
label values politicstreat treatlab 
label values policytreat treatlab 

**Contentious Politics
regr contentious i.politicstreat##i.ca1, cluster(caseid)
**Conflict Avoidant
margins, dydx(politicstreat) at(ca1=2)
**Conflict Seeking
margins, dydx(politicstreat) at(ca1=1)

**Mind Change Politics
regr mindchange i.politicstreat##i.ca1, cluster(caseid)
**Conflict Avoidant
margins, dydx(politicstreat) at(ca1=2)
**Conflict Seeking
margins, dydx(politicstreat) at(ca1=1)

**Contentious Policy
regr contentious i.policytreat##i.ca1, cluster(caseid)
**Conflict Avoidant
margins, dydx(policytreat) at(ca1=2)
**Conflict Seeking
margins, dydx(policytreat) at(ca1=1)

**Mind Change Policy
regr mindchange i.policytreat##i.ca1, cluster(caseid)
**Conflict Avoidant
margins, dydx(policytreat) at(ca1=2)
**Conflict Seeking
margins, dydx(policytreat) at(ca1=1)


**Study in SI8 on Demographics and Conflict Avoidance
use "Study in SI8 - YouGov.dta", clear

**Conflict Avoidance
**1 is avoidant
gen ca_v=SBU603
recode ca_v 8=.
recode ca_v 1=0 2=1

**Demographics
gen gender1=gender
recode gender1 1=0 2=1
gen black=race
recode black 1=0 2=1 3/8=0
gen latin=race
recode latin 1=0 2=0 3=1 4/8=0
gen asian=race
recode asian 1/3=0 4=1 5/8=0
gen INCOME=faminc_new
recode INCOME 97=.
gen AGE=2022-birthyr
gen min_rel=religpew
recode min_rel 1/4=0 5/8=1 9/12=0

**Models in SI8 YouGov Models 5 and 6
reg ca_v gender1 latin black asian educ AGE INCOME min_rel
reg ca_v gender1 latin black asian educ AGE INCOME min_rel [pweight=weight]


**Study in DA8
import spss using "Study in DA8 - Replication of Survey Selection.sav", clear

gen woman=gender
recode woman 1=0 2=1

**All Options in the DV
gen fulldv=SBU354 if SBU354!=. 
replace fulldv=SBU355 if SBU355!=. 
replace fulldv=SBU356 if SBU356!=. 

**Removing People who said Neither
gen poldv=fulldv
recode poldv 1=1 2=0 3=.

**Treatment
gen futuretreat=0 if SBU354!=. 
replace futuretreat=1 if SBU355!=. 
replace futuretreat=2 if SBU356!=. 
label define futurelab 0 "Control" 1 "Debate" 2 "Agreement"
label values futuretreat futurelab

gen conavoid=SBU307


**DA9.2 Rows listed under "Survey Replication (YouGov, SI 15)"
ttest poldv if futuretreat==0, by(woman)
ttest poldv if futuretreat==2, by(woman)
ttest poldv if futuretreat==1, by(woman)
ttest poldv, by(woman)


**DA8.2 - Multinomial Logit
mlogit fulldv i.futuretreat##c.conavoid

**DA8.2 - Logit
logit poldv i.futuretreat##c.conavoid

**DA8.2 - OLS
regr poldv i.futuretreat##c.conavoid


